package com.jyw.business.de.domain.vo.web;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jyw.business.de.domain.DeDemandMake;
import com.jyw.common.annotation.Conversion;
import com.jyw.common.annotation.Excel;
import com.jyw.common.enums.ConversionType;
import com.jyw.common.utils.bean.BeanUtils;
import com.jyw.system.domain.vo.SimpleFileVo;
import com.jyw.system.utils.FileUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;

import java.util.Date;
import java.util.List;

@Data
@ApiModel("需求处理信息返回实体")
@FieldNameConstants
@NoArgsConstructor
public class DemandMakeVO {

    /** 主键 */
    @ApiModelProperty("主键")
    private Long id;

    /** 处理描述 */
    @ApiModelProperty("处理描述")
    private String makeRemark;

    /** 需求进度(整数0-100) */
    @ApiModelProperty("需求进度(整数0-100)")
    private Integer makeProcess;

    /** 附件 */
    @ApiModelProperty("附件")
    private List<SimpleFileVo> makeEnclosure;

    /** 处理人 */
    @ApiModelProperty("处理人")
    @Conversion(value = ConversionType.USER,name = Fields.createUserName)
    private Long createUser;

    @ApiModelProperty("处理人名称")
    private String createUserName;

    /** 处理时间 */
    @ApiModelProperty("处理时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    public DemandMakeVO(DeDemandMake data) {
        BeanUtils.copyProperties(data,this);
        setMakeEnclosure(FileUtils.IdToFile(data.getMakeEnclosure()));
    }
}
